using System.Collections;
using System.Collections.Generic;
using CustomLitJson;
using UnityEngine;
using UnityEngine.UI;


public class DeveloperModeSettings
{
    /// <summary>
    /// 开发者开关
    /// 在编辑器上默认值为 true
    /// 在真机上默认值为 false
    /// </summary>
    public static bool IsDevelopmentMode
    {
        get
        {
            return PlayerPrefsUtil.GetBool(nameof(IsDevelopmentMode), Default);
        }
        set
        {
            PlayerPrefsUtil.SetBool(nameof(IsDevelopmentMode), value);
        }
    }

    public static bool Default
    {
        get
        {
            if(Application.isEditor)
            {
                return true;
            }
            else
            {
                var b = GameManifestManager.Stuff.Get("develop.default");
                return bool.Parse(b);
            }
        }
    }


    public static void DeleteCache()
    {
        PlayerPrefs.DeleteKey(nameof(IsDevelopmentMode));
    }

}